home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / TrayItemSetText.au3 < prev    next >
Text File  |  2007-09-08  |  594b  |  28 lines

  1. #Include <Constants.au3>
  2. #NoTrayIcon
  3.  
  4. Opt("TrayAutoPause",0)    ; Script will not be paused when clicking the tray icon.
  5.  
  6. $valitem    = TrayCreateItem("Val:")
  7. TrayCreateItem("")
  8. $aboutitem    = TrayCreateItem("About")
  9.  
  10. TraySetState()
  11.  
  12. TrayItemSetText($TRAY_ITEM_EXIT,"Exit Program")
  13. TrayItemSetText($TRAY_ITEM_PAUSE,"Pause Program")
  14.  
  15. While 1
  16.     $msg = TrayGetMsg()
  17.     Select
  18.         Case $msg = 0
  19.             ContinueLoop
  20.         Case $msg = $valitem
  21.             TrayItemSetText($valitem,"Val:" & Int(Random(1,10,1)))
  22.         Case $msg = $aboutitem
  23.             Msgbox(64,"About:","AutoIt3-Tray-sample")
  24.     EndSelect
  25. WEnd
  26.  
  27. Exit
  28.